-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version	5.0.45-community-nt


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;


--
-- Create schema accountability4net
--
DROP DATABASE accountability4net;
CREATE DATABASE accountability4net;

USE accountability4net;
CREATE TABLE `account` (
  `Number` int(10) unsigned NOT NULL auto_increment,
  `Type` enum('ASSET','LIABILITY','INCOME','EXPENSE') NOT NULL,
  `Balance` decimal(10,4) NOT NULL default '0.0000',
  `Name` varchar(255) default NULL,
  `Description` varchar(4096) default NULL,
  PRIMARY KEY  (`Number`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;

CREATE TABLE `action` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `transaction_id` varchar(255) default NULL,
  `type` enum('DEBIT','CREDIT') NOT NULL,
  `amount` decimal(10,4) NOT NULL,
  `account_id` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=latin1;

CREATE TABLE `transaction` (
  `Id` varchar(255) NOT NULL,
  `Timestamp` BIGINT(8) UNSIGNED NOT NULL DEFAULT 0,
  `Description` text,
  `Commited` tinyint(1) NOT NULL,
  PRIMARY KEY  (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `contact` (
  `id` varchar(255) NOT NULL,
  `email` varchar(255) default NULL,
  `name.familyName` varchar(255) default NULL,
  `name.givenName` varchar(255) default NULL,
  `name.additionalNames` varchar(255) default NULL,
  `name.namePrefix` varchar(255) default NULL,
  `name.nameSuffix` varchar(255) default NULL,
  `name.formattedName` varchar(255) default NULL,
  `photo` blob,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
